import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../home/Index'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    component: Index,
    meta: { title: '首页' }
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('./../home/Home'),
    redirect: '/',
    meta: { title: '关于我们' },
    children: [
      {
        path: 'about/:id',
        name: 'about',
        component: () => import('./../home/About'),
        meta: { title: '关于我们' }
      },
      {
        path: 'scheme',
        name: 'scheme',
        component: () => import('./../home/scheme'),
        meta: { title: '解决方案' }
      },
      {
        path: 'product',
        name: 'product',
        component: () => import('../home/Product'),
        meta: { title: '产品' }
      },
      {
        path: 'case',
        name: 'case',
        component: () => import('../home/Case'),
        meta: { title: '案例' }
      },
      {
        path: 'callIncoming',
        name: 'callIncoming',
        component: () => import('./../home/CallIncoming'),
        meta: { title: '呼入' }
      }
    ]
  }
  // {
  //   path: '/about',
  //   name: 'About',
  //
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'hash',
  routes
})

export default router
